Installation
Requirements
- The android minimum version for the SDK is 6.0 (API 23)
minSdkVersion: 23
Changes in build.gradle
caution
Our old repository (JFrog) will not be available soon, please replace the maven URL with the following https://storage.googleapis.com/production-mobile-sdks/android/
- Add repository.
.....
allprojects {
repositories {
....
maven { url "https://storage.googleapis.com/production-mobile-sdks/android/" }
....
}
- Declare library in dependencies section. At app module gralde file
implementation 'com.meetingdoctors:videocall-sdk:{last_version}' //See Release Notes
Initialization
- Initialize library on your Application.onCreate(). apiKey is a constant string provided by MeetingDoctors.
VideoCallClient.initialize(
this,
<YOUR_API_KEY>,
<YOUR_INSTALLATION_GUID>,
<ENABLE_DATA_ENCRYPTION> true/false,
<ENCRYIPTION_PASSWORD> "yourEncryptionPassword",
object : VideoCallClient.InitResponseListener {
override fun onInitSuccess() {
}
override fun onInitFailure(s: String?) {
}
},
//You must set a value from enum class VideoCallBuildMode
<BUILD_MODE_ENVIRONMENT> VideoCallBuildMode.DEV/STAGING/PROD,
// If you do not want to set specific locale just set <LOCALE> to null,
//Locale configuration will be handled by Android system as usual
//e.g. Locale locale = Locale("es")
<LOCALE> "yourLocaleLanguage"
)
- InstalllationGuid is an unique identifier required to initialize, for a clean way to generate it, check snippet below:
UUID.nameUUIDFromBytes(
(Settings.Secure.getString(
context.contentResolver,
Settings.Secure.ANDROID_ID
) +
Build.VERSION.RELEASE +
Build.MODEL +
Repository.apiKey +
Math.random()).toByteArray()
).toString()
Screenshots Feature
Screenshots captures can be enabled easily via following method:
VideoCallClient.initialize(
this,
<YOUR_API_KEY>,
<YOUR_INSTALLATION_GUID>,
<ENABLE_DATA_ENCRYPTION> true/false,
<ENCRYIPTION_PASSWORD> "yourEncryptionPassword",
object : VideoCallClient.InitResponseListener {
override fun onInitSuccess() {
}
override fun onInitFailure(s: String?) {
}
},
//You must set a value from enum class VideoCallBuildMode
<BUILD_MODE_ENVIRONMENT> VideoCallBuildMode.DEV/STAGING/PROD,
// If you do not want to set specific locale just set <LOCALE> to null,
//Locale configuration will be handled by Android system as usual
//e.g. Locale locale = Locale("es")
<LOCALE> "yourLocaleLanguage"
).setScreenshotsCapturesEnabled(true)
User Login
- Before perform a video call , you must login. userToken is a constant string that will allow you to validate user from your own server.
VideoCallClient.login(<YOUR_USER_TOKEN>, object : VideoCallClient.LoginResponseListener{
override fun onLoginSuccess() {
/* Your code here */
}
override fun onLoginFailure(message: String?) {
/* Your code here */
}
})
Cordova
- When you use Cordova to implement the SDK, there is a possibility that you must include this snippet in the manifest.
<activity android:name="com.meetingdoctors.videocall.presentation.error.ErrorActivity" android:theme="@style/Theme.AppCompat" />
<activity android:name="com.meetingdoctors.videocall.presentation.waitingroom.WaitingRoomActivity" android:theme="@style/Theme.AppCompat" />
<activity android:name="com.meetingdoctors.videocall.presentation.permissions.PermissionsActivity" android:theme="@style/Theme.AppCompat" />
<activity android:name="com.meetingdoctors.videocall.presentation.initvideocall.InitVideoCallActivity" android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name="com.meetingdoctors.videocall.presentation.videocall.VideoCallActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>
<activity
android:name="com.meetingdoctors.videocall.presentation.startvideocall.StartVideocallActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>